3.31 \(\int (a-a \sin ^2(x)) \, dx\)

Optimal. Leaf size=16 \[ \frac{a x}{2}+\frac{1}{2} a \sin (x) \cos (x) \]

[Out]

(a*x)/2 + (a*Cos[x]*Sin[x])/2

________________________________________________________________________________________

Rubi [A]  time = 0.0085589, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2635, 8} \[ \frac{a x}{2}+\frac{1}{2} a \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[a - a*Sin[x]^2,x]

[Out]

(a*x)/2 + (a*Cos[x]*Sin[x])/2

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (a-a \sin ^2(x)\right ) \, dx &=a x-a \int \sin ^2(x) \, dx\\ &=a x+\frac{1}{2} a \cos (x) \sin (x)-\frac{1}{2} a \int 1 \, dx\\ &=\frac{a x}{2}+\frac{1}{2} a \cos (x) \sin (x)\\ \end{align*}

Mathematica [A]  time = 0.0028456, size = 16, normalized size = 1. \[ a \left (\frac{x}{2}+\frac{1}{4} \sin (2 x)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[a - a*Sin[x]^2,x]

[Out]

a*(x/2 + Sin[2*x]/4)

________________________________________________________________________________________

Maple [A]  time = 0.019, size = 18, normalized size = 1.1 \begin{align*} ax-a \left ( -{\frac{\sin \left ( x \right ) \cos \left ( x \right ) }{2}}+{\frac{x}{2}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a-a*sin(x)^2,x)

[Out]

a*x-a*(-1/2*sin(x)*cos(x)+1/2*x)

________________________________________________________________________________________

Maxima [A]  time = 0.97762, size = 23, normalized size = 1.44 \begin{align*} -\frac{1}{4} \, a{\left (2 \, x - \sin \left (2 \, x\right )\right )} + a x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a-a*sin(x)^2,x, algorithm="maxima")

[Out]

-1/4*a*(2*x - sin(2*x)) + a*x

________________________________________________________________________________________

Fricas [A]  time = 1.64897, size = 42, normalized size = 2.62 \begin{align*} \frac{1}{2} \, a \cos \left (x\right ) \sin \left (x\right ) + \frac{1}{2} \, a x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a-a*sin(x)^2,x, algorithm="fricas")

[Out]

1/2*a*cos(x)*sin(x) + 1/2*a*x

________________________________________________________________________________________

Sympy [A]  time = 0.155767, size = 15, normalized size = 0.94 \begin{align*} a x - a \left (\frac{x}{2} - \frac{\sin{\left (x \right )} \cos{\left (x \right )}}{2}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a-a*sin(x)**2,x)

[Out]

a*x - a*(x/2 - sin(x)*cos(x)/2)

________________________________________________________________________________________

Giac [A]  time = 1.1417, size = 23, normalized size = 1.44 \begin{align*} -\frac{1}{4} \, a{\left (2 \, x - \sin \left (2 \, x\right )\right )} + a x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a-a*sin(x)^2,x, algorithm="giac")

[Out]

-1/4*a*(2*x - sin(2*x)) + a*x